home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1993 November / JCSM Shareware Collection - 1993-11.iso / cl820 / prin31j.lzh / PRIN31.DOC < prev    next >
Encoding:
Text File  |  1992-11-11  |  19.0 KB  |  487 lines

  1.                                    PRIN
  2.                                 Version 3.1
  3.                       Copyright (C) Drake Koefoed 1992
  4.  
  5. Major changes:
  6.  
  7. Version 3.1 new things are the Z option for respect the original
  8. pagination, named z because it's probably the last thing you want to do.
  9. And the U option for an upper margin at top of each page.
  10.  
  11. New features truncate and box aliasing. The case sensitive commands are
  12. gone.  You may now type prin commands in caps if you can stand them.
  13.  
  14. Prin now keeps track of lines and pages printed, and the start and
  15. finish time of the print job.  Every print job is a printer speed test.
  16. Not a prin speed test; on a 16 mhz sx it will do over 100 lines a second
  17. printing to a ram disk.
  18.  
  19. By use of this program, you agree to hold the author free from any
  20. liability of any kind.  See legal junk at the end.
  21.  
  22.  
  23. CONTENTS
  24. ========
  25.  
  26. How to use prin
  27. Command line options
  28. Altering defaults
  29. Beta testing
  30. Registration
  31. Laurels and Legalese
  32.  
  33.  
  34. HOW TO USE PRIN
  35. ===============
  36.  
  37. PRIN is called up by the command
  38.  
  39.         PRIN filename [options]
  40.  
  41. where (filename) is the name of a file.  If no filename or options are
  42. specified, you get a help screen.  Otherwise, PRIN will print the
  43. contents of the file named, at 60 lines per page (unless you specify
  44. another page size with the /l parameter, explained below).  Unless you
  45. use the /n parameter (explained below), PRIN will print the filename
  46. in all caps at the top of the first page.
  47.  
  48. You may abort what's printing at any time by pressing escape.  PRIN
  49. will discontinue printing the file, but bear in mind that there are
  50. two factors to consider:
  51.  
  52. *  Your printer may have a substantial buffer, which is usually full
  53.    because PRIN runs much faster than a printer.  The printer will
  54.    continue to print what's in that buffer, even after PRIN has been
  55.    aborted, though PRIN will return to the DOS prompt.
  56.  
  57. *  PRIN checks for an escape before sending each line;  DOS suspends
  58.    PRIN while the printer empties enough of its buffer to accept
  59.    another line; only when PRIN has control back will it abort the
  60.    printing.
  61.  
  62. While we're speaking of aborts, it helps to turn the printer on before
  63. you start printing, but you don't have to.  If it's off, you will get
  64. the nasty message from DOS: "Error writing device PRN.  Abort, Retry,
  65. Fail, Ignore?". Just turn the printer on and hit r.  It will print as
  66. if nothing had happened.  I do this a lot because I turn my printers
  67. off when something goes wrong, and when you're testing a printing
  68. program, that is not uncommon.
  69.  
  70. In answer to the obvious(?) question, no, I can't test if PRN is on. I
  71. could test to see if LPT 1 was on, but you can use the MODE command to
  72. redirect PRN to another port, in which I would be testing the wrong
  73. device.  If this doesn't make any sense to you, don't worry, you don't
  74. need to know it.
  75.  
  76. PRIN replaces form-feeds  embedded in the file with linefeeds, so it
  77. ignores the existing pagination of the file.  This is handy when
  78. printing out shareware documents that have weird page lengths, useless
  79. formfeeds, or no pagination at all.
  80.  
  81. PRIN sends an Escape-@  to the printer on startup, (unless you use the
  82. i option, explained below), which is a RESET to an Epson and many
  83. others.   Some printers, however, may not understand this code, in
  84. which case they will not reset.
  85.  
  86. PRIN depends on you to set the paper to the TOP OF FORM before
  87. starting.  60 (or whatever is set by the /l parameter) lines will be
  88. printed, and then a formfeed.   When the end of file is reached,
  89. another formfeed will be sent to eject the last page, and PRIN will
  90. exit.  On dot matrix printers, you can roll the paper up a bit and
  91. reduce the lines per page with /L to create top margins on all pages.
  92.  
  93. COMMAND LINE OPTIONS
  94. ====================
  95.  
  96. Spaces or forward slashes will have the same effect.  Programmers refer
  97. to these things as delimiters, because they mark the limits of the
  98. filename and the command line parameters.  If you use some that are not
  99. needed, prin will ignore them.
  100.  
  101. NO FILENAME AT TOP OF FIRST PAGE: /N
  102. -----------------------------------
  103.  
  104. The N option prevents the filename from being printed.  You can say
  105.  
  106.         PRIN myfile/N
  107. or
  108.         PRIN myfile n
  109.  
  110. Either will stop the filename from being printed.
  111.  
  112. OMIT DATE AND TIME FROM FILENAME: O
  113. -----------------------------------
  114.  
  115. The O option prevents the date and time of the file from being printed.
  116. If the filename is not printed, then the date and time are automatically
  117. left off.
  118.  
  119.  
  120. LINES PER PAGE: L
  121. -----------------
  122.  
  123. The L option sets the number of lines to the number following.
  124. For example:
  125.  
  126.         PRIN filename l55
  127.  
  128. would cause PRIN to print out the file called filename at 55 lines per
  129. page. This number must be two digits.  ( use 05 for 5 lines per page.)
  130.  
  131. PAGE NUMBERING: P
  132. -----------------
  133.  
  134. The P option numbers the pages in the upper right.
  135.  
  136. MARGIN AT LEFT: M
  137. -----------------
  138.  
  139. The M option adds a left margin of five characters unless the line is
  140. too long.  I add a margin to any line that will fit on the page with
  141. one.  If it won't I print that line without a margin. Using the default
  142. linelength, you will get margins if your lines are not over 75
  143. characters.  This feature keeps your printout away from the area that
  144. hole punches punch in.
  145.  
  146. If you need a margin but have lines longer than 75 chars, what you can
  147. do is prin to a file on your ramdisk, using the m function and a line
  148. length of 90 or whatever, then prin the ramdisk file with the t option,
  149. and chop off whatever is necessary.  This is tricky, but will give you a
  150. good example of how to use prin.  Examples and reasons follow.
  151.  
  152. prin filename f m r90 l00 i
  153.  
  154. -filename is the file you are printing.
  155.  
  156. -f means print to file.  We do this in two stages.
  157.  
  158. -r90 means right margin 90 so the left margin can be added even though
  159. the lines are already 80 chars long.
  160.  
  161. -l00 tells prin not to put in formfeeds.  You want this because when you
  162. actually  print, prin will substitute linefeeds for the formfeeds, and
  163. you do not want the blank lines.
  164.  
  165. -i is initialization off.  We will let prin initialize the printer when
  166. we print to the printer.  No need for an escape @ in the file we are
  167. making.
  168.  
  169. Now that we have our output file, which I will assume you named outfile,
  170. we go to the business of printing to the printer:
  171.  
  172. prin outfile n t
  173.  
  174. -n for no filename on printout because the first time through we got the
  175. file name, and this time the file name is just the temporary file name
  176. of the file on the ramdrive, and it is not anything we want on the real
  177. printout.
  178.  
  179. -t tells prin to truncate long lines.  The default 80 will be used for
  180. line length unless you use an rxx or rxxx command for something else.
  181.  
  182. You should now have a printout with a left margin all the way down, and
  183. the lines that are too long cut off where they had to be.  Needless to
  184. say if you do this sort of thing all the time you will want to do it
  185. with a batch file that might read something like this if D: is your ram
  186. disc:
  187.  
  188. echo d:\temp |prin %1 f m r90 l00 i
  189. prin d:\temp n t
  190. del d:\temp
  191.  
  192. This will run prin twice so fast you will probably wonder what in the
  193. world it is doing.  Note that the name temp must not exist or prin will
  194. get all huffy about being asked to use an existing file name.
  195.  
  196. This is provided in advanced.zip as the file mprin.bat
  197.  
  198. RIGHT MARGIN: Rxx or Rxxx
  199. -------------------------
  200.  
  201. (where xx or xxx is a number between 10 and 244.)
  202. R is the maximum line length.  The default is 80.  the R parameter
  203. sets the point at which PRIN will wrap.  I wrap at the last space
  204. before that.  I back up half the line length looking for a space
  205. before I give up and call a procedure called "dumbwrap" that cuts the
  206. "word" at the edge of the print area.  Since
  207. "antidisestablishmentarianism" is well under 40 characters, you will
  208. probably not see "dumbwrap" at work unless you try to print out some
  209. graphics boxes and use too narrow a margin.  The default wrap point is
  210. the last space before 80 characters. This option is not a substitute
  211. for a word processor.  It wraps those lines that do not fit, but
  212. starts the next line at the beginning.  It is intended primarily to
  213. protect the occasional long line in program source code from being
  214. chopped off on printing, or printing off the edge of the paper.
  215.  
  216. INITIALIZATION OFF: I
  217. ---------------------
  218.  
  219. You may want to use a batch file that sends a file to the printer with
  220. copy or some program to set your printer to near letter quality or
  221. whatever.  If you do, this option prevents PRIN from sending the reset
  222. and wiping out what is in the printer's memory.  This means PRIN will
  223. use whatever font, top of form, etc. the printer is currently set to.
  224. Not all printers use escape @ and those that do do not all clear the
  225. same things.  Standards?  We don't need no stinking standards!
  226.  
  227. DOUBLESPACE: D
  228. --------------
  229.  
  230. Prints blank lines between the lines in the original file.  Handy for
  231. creating a scratch copy of a file without changing the file itself,
  232. especially if you're writing the file with an editor that does not do
  233. doublespace.
  234.  
  235. PRINT TO FILE: F
  236. ----------------
  237.  
  238. Prints the output to a file.  This file may be printed later with the
  239. copy command.  This lets you use prin to generate such things as
  240. shareware doc files on discs with embedded formfeeds and page numbers.
  241. Normally you would not use prin to print this output file, because
  242. prin would just filter the formfeeds back out again.  Prin outputs a
  243. line at a time, which is reasonable for a printer, but not very
  244. efficient for writing to files.  Large documents are best handled by
  245. writing to a ram disc and then copying.
  246.  
  247. To fully appreciate the speed of prin, you need to do a print to disc of
  248. a large document onto a ramdrive.  On a fast machine, you simply will
  249. not be able to see the last two digits of lines printed.
  250.  
  251. SET TABSIZE: B
  252. --------------
  253.  
  254. Sets the tabsize to a single nonzero digit, 1 to 9.
  255.  
  256. for example:
  257.  
  258.         PRIN filename B5
  259.  
  260. would cause prin to space over to the next column that is a multiple of
  261. 5 each time a tab is encountered.  Default is 8, which is the same as
  262. DOS print uses.
  263.  
  264.  
  265. ALTERING DEFAULT SETTINGS:
  266. --------------------------
  267.  
  268. CLONE: C
  269. --------
  270.  
  271. Clones the program to the current settings.  The file to be cloned must
  272. be named prin.com, and it must be in the current directory.  Once
  273. cloned, the program may be named anything you wish provided you keep the
  274. extension .com.  This may be useful for creating one copy that prints
  275. doublespace, one that prints with no filename, etc, so you can avoid
  276. typing any parameters at all.
  277.  
  278. KLONE: K
  279. --------
  280.  
  281. Klones the program to the defaults.  the file to be cloned must be
  282. named prin.com, and must be in the current directory.  You must give a
  283. filename, but if you do not want to print something with the current
  284. settings, the file you name should be nonexistent.  Klone will take
  285. effect, and then prin will try to open the nonexistent file to print
  286. out, and exit with the file not found error message.  Klone affects the
  287. file on disc, not what is in memory.
  288.  
  289. EXAMPLE:
  290. --------
  291.  
  292.         prin nonesuch K
  293.  
  294. This would Klone the program to the defaults, and then look for nonesuch
  295. to be printed with the existing settings.  Since nonesuch does not
  296. exist, nothing will be printed with the settings in memory (the old
  297. ones), and prin will exit, having changed the program on disc to the
  298. default settings.  The next time PRIN is called, the default settings
  299. will be in effect.
  300.  
  301. TRUNCATE: T
  302. -----------
  303.  
  304. Programmers often want to print out list files that have more than 80
  305. characters per line.  My assembler will make them wrap, and so can prin,
  306. but that is not really what I want.  The stuff that is off the end is
  307. just the tail ends of comments.  It's confusing to have them wrapped to
  308. come up in the code field.  T chops off everything beyond the user
  309. specified right edge.
  310.  
  311. BOX ALIASING: A
  312. ---------------
  313.  
  314. ---------,           The A option allows you to have prin substitute
  315.          :                         ascii characters for the
  316.     ,----:-------------------,          box characters.
  317.     :    :  Stop             :
  318.     :    :          box      :
  319.     :    :   messes          :
  320.     :    :                   :
  321.     :    '-------------------'
  322.     :
  323.     :      Since this option is needed worst by users with daisey
  324.     :      wheel printers, I chose :',- as the alias characters.
  325.     :
  326.     '--------------------------------------,
  327.                                            :
  328.                                            :
  329.                                            '------
  330.  
  331.  
  332. This gives best chance of being able to print.  The | does look a bit
  333. more like a vertical line, but not much, and I think it is considerably
  334. less common.  And we need to put a stop to these:
  335.  
  336.                          ZDDDDDDDDDDDDDDDDDDDDDDDDDDD?
  337.                          3                           3
  338.                          3                           3
  339.                          3                           3
  340.                          @DDDDDDDDDDDDDDDDDDDDDDDDDDDY
  341.  
  342. TOP MARGIN: U
  343. -------------
  344.  
  345. Specify a top margin to go on each page below the page numbers and
  346. filename, and above the text.  Must be single digit, so 9 is as big as
  347. you can go without playing tricks with print to file and so on.  6 lines
  348. is normally an inch.  Most printers have a reasonable top margin of
  349. their own, but that is not true of a printer owned by one of my
  350. registered users, Richard Conrad.  He sent me some printouts.  The
  351. margins were very near the top.  They did not look good.  It was
  352. intolerable.  It's fixed.  Usage is  /ux where x is the number of blank
  353. lines.
  354.  
  355. RESPECT ORIGINAL PAGINATION: Z
  356. ------------------------------
  357.  
  358. You may have something you think is going to print out all right.  What
  359. you want is for prin to sit quietly by and let the file break pages as
  360. it wants unless a page goes over the maximum length you allow.  This
  361. will keep the printer off the perforations, but of course it will allow
  362. one line pages, one of the main curses prin was written to stop.
  363. However, you may want to add top margins to something that is paginated
  364. right, or add page numbering, or something I never even thought of.  The
  365. Z option goes to the next page whenever it gets a formfeed out of the
  366. file.  But prin still provides the services you have come to expect.
  367. Possibly good for things like printing list files you want to truncate
  368. to 80 chars, or something real tricky you've thought up.
  369.  
  370.  
  371. EXAMPLES:
  372. =========
  373.  
  374.         prin PRIN30.doc
  375.  
  376. This would print PRIN30.DOC at 60 lines per page, with the filename at
  377. the top of the first page.
  378.  
  379.          prin PRIN30.doc l58 n m p
  380.  
  381. This will print PRIN30.DOC at 58 lines per page *without* the filename
  382. at the top, add a margin of five spaces at the left, and number the
  383. pages.
  384.  
  385.         prin bigfile.txt z f u3 a t r75 L62
  386.  
  387. This will print BIGFILE.TXT in its original pages unless they go over
  388. the 62 lines per page the user has specified.  Output will be to a file
  389. the user will be asked for a name for, box characters will be converted
  390. to ascii, and the long lines will be truncated to the right margin of 75
  391. the user has specified.
  392.  
  393.  
  394. PRIN is written in ASSEMBLER, so it is very small and fast.  I have run
  395. {COMMO} in one window of Desqview and PRIN in another with no noticeable
  396. slowing of print speed on an 8 mhz XT.  I have been shamelessly eating
  397. up memory, and have enlarged my buffer so prin is now 16k in memory.
  398. Probably you will need to allow 17k to run it from a .bat file under
  399. Desqview.  You will find PRIN works much better than the DOS print in
  400. this situation, because it uses much less CPU time.Also, PRIN is NOT
  401. memory resident.
  402.  
  403.  
  404. ERROR CODES
  405. ===========
  406. On errors, I save the DOS error code and return it on termination, so
  407. you can find out what went wrong if you want.  On successful termination,
  408. I return an errcode of zero.  My own errcode is 96. (60h). Have
  409. fun, batch freaks!
  410.  
  411.  
  412.  
  413. REGISTRATION:
  414. =============
  415.  
  416. Now here is my favorite part: If you use prin, and it works for you, the
  417. right thing to do is to pay for it.  Please send $6 to the address
  418. below.  The I will send you a password and instructions for converting
  419. PRIN to the registered version.
  420.  
  421. Registered users can call and get help on assembler, including having an
  422. escape code file made for them.  All you need to do is log on and say,
  423. "hey, remember me?  Well, I just gotta have this escape code, and I
  424. can't figure out how to do it."
  425.  
  426. SITE LICENSES
  427. -------------
  428.  
  429. I have been asked by one user for a site license price.  I considered
  430. the possibilities of a pricing schedule.  If I charged by machines
  431. using the program, it could be put on a file server and one copy could
  432. print thousands of pages a day.  If I charged by the copy, users who
  433. had one printer and a large number of computers might pay a lot though
  434. they do little printing.  In the end I decided I could think of no
  435. formula that would really be fair, and so I told this user what I am
  436. now telling you.  The price of a site license for prin is to be set by
  437. the user in good faith, as that amount which, all things considered,
  438. is a fair price.  The license is not limited as to the number of
  439. copies that can be run.  It is only the honest few who register at
  440. all, and in the end, I think they can be trusted to be fair.
  441.  
  442. THOSE DAMN BLINKING DOTS
  443. ------------------------
  444.  
  445. They probably bother me more than they do you.  But more a than year
  446. after the original release of prin, I have less registrations than phone
  447. bills from uploading it.  It's being used all over the world, but people
  448. are just not getting around to sending checks.  It may well be more a
  449. case of procrastination than dishonesty.  I tried to do something that
  450. would keep registration on your mind without being a pain.  The ascii
  451. 250 I used is the _smallest_ character in the set.  It's half the size
  452. of a period on my (mono) monitor.
  453.  
  454.  
  455. PRICING:
  456. --------
  457.  
  458. Prin is priced considerably lower than most comparable
  459. programs, if there are such things.  This reflects a view of shareware
  460. that it should be less expensive than commercial software even when it's
  461. better.  If users enthusiastically upload it, and encourage others to
  462. register, I think I will eventually be paid reasonably for the work I
  463. have done.
  464.  
  465.                        Drake Koefoed
  466.                  1409 Oakpatch road # A 9
  467.                     Eugene Oregon 97402
  468.  
  469.  
  470. LAURELS AND LEGALESE
  471. ====================
  472. Desqview is the property of Quarterdeck. It's a great program.
  473. {Commo} is the property of Fred Brucker.  It's a greater program.
  474.  
  475. The latest version of {Commo} is always available on assembler,
  476. and first time callers are able to download.
  477.  
  478.  
  479.  
  480.  
  481. BY USING THIS PROGRAM YOU AGREE TO HOLD THE AUTHOR FREE OF ALL LIABILITY
  482. OF ANY KIND TO THE EXTENT PERMITTED BY LAW.  YOU ASSUME THE RISK OF
  483. ANYTHING THAT HAPPENS.  THIS PROGRAM IS SOLD WITHOUT WARRENTY OF ANY
  484. KIND, INCLUDING FITNESS FOR A PARTICULAR PURPOSE AND MERCHANTABILITY.
  485. REMEDIES ARE LIMITED TO THE REFUND OF THE REGISTRATION FEE.
  486.  
  487.